<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="head.jsp" %>
<%@page import="java.util.Date" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://chances.com.cn/jsp/epgutils" prefix="epgutils"%>
<epgutils:wechatUrl var="listReqUrl" action="listReq" from="null" path="/wechat/play/listRequest.wx"/>
<epgutils:wechatUrl var="reqDelsUrl" action="delReq" from="null" path="/wechat/play/delReqs.wx"/>
<!DOCTYPE html>
<html>
<head>
	<title>SMART_TV</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<%@include file="/sites/weixin/js/common.jsp" %>
	<%@include file="/sites/weixin/common/common_js.jsp" %>
	<link rel="stylesheet" type="text/css" href="${_contextPath}/sites/weixin/css/wx.css" />
	<%@include file="check.jsp" %>
</head>
<body>
<!-- 内容 -->
<c:set var="title"  value="历史记录"/>
<c:set var="emptyPicName"  value="history_empty"/>
<c:set var="icon"  value="hs"/>
<%@include file="personListCommon.jsp" %>

<script>
function doDelete(){
	if(selectCodes.length > 0){
		showLoading('正在删除');
		var result  = selectCodes.join(",");//JSON.stringify(selectCodes);
		var delsUrl = "${reqDelsUrl}";
		stbCtrl.dels(result,'play', "${EPG_USER_SESSION.userId}", delsUrl, function() {
			refleshLocalHistory(selectCodes);
			for(var i=0;i<selectCodes.length;i++){
				$("#"+selectIds[i]+"_row").remove();
				$("#"+selectIds[i]+"_line").remove();
			}
			var left = $(".person-content-small");
			if(left.length == 0){
				window.location.href = window.location.href;
			}
			$("#loadingToast").hide();
			showToast('删除成功',1000);
			deleteCancel();
		});
	}	
}
function refleshLocalHistory(historyArray){
	for(var i=0;i<historyArray.length;i++){
		playStorage.remove(historyArray[i]);
	}
}

var vm = new Vue({
	el:"#app",
	data:{
		resourcePath:'${_resource}',
		contextPath:'${_contextPath}',
		content:[],
		type:"history"
	},
    mounted: function () {
		this.$nextTick(function () {
			listCollect();
	 	});
    },
    methods:{
    	check:check,
    	uncheck:uncheck,
    	playContent:function(){
    		
    	},
    	getCreateTime:getCreateTime,
    	isToday:isToday,
    	personPlay:personPlay
    }
});
function listCollect(){
	var url = "${listReqUrl}";
	var data = {
		userId:'${EPG_USER_SESSION.userId}',
		type:'play',
		size:100
	};
	listContent(url,data);
}
function refreshLocalStorage(){
	//无需处理
}
</script>
<%@include file="/sites/weixin/common/bodyEndVm.jsp" %>
</body>
</html>